<template>
  <div>
    <v-indexTop></v-indexTop>
    <div class="rsm-main">
      <div class="r-h2">
        <h1>工作经历</h1>
        <span>快速完善简历，理想职位又进一步</span>
      </div>
      <div class="rsm-model">
        <div>
          <ul>
            <li>
              <p>公司名称</p>
              <el-input placeholder="请输入内容" v-model="componyname" clearable>
              </el-input>
            </li>
            <li>
              <p>所属行业</p>
              <el-cascader
                v-model="value"
                :options="options"
                :props="{ expandTrigger: 'hover' }"
              ></el-cascader>
            </li>
            <li>
              <p>职位名称</p>
              <el-input placeholder="请输入内容" v-model="position" clearable>
              </el-input>
            </li>
            <li>
              <p>所属部门</p>
              <el-input placeholder="请输入内容" v-model="bumen" clearable>
              </el-input>
            </li>
            <li>
              <p>开始工作时间</p>
              <el-date-picker
                v-model="end_date"
                type="date"
                placeholder="入职时间"
              >
              </el-date-picker>
            </li>
            <li>
              <p>结束工作时间</p>
              <el-date-picker
                v-model="begin_date"
                type="date"
                placeholder="离职时间"
              >
              </el-date-picker>
            </li>
            <li>
              <p>工作职责：</p>
              <el-input
                type="textarea"
                placeholder="请输入内容"
                v-model="textarea"
                maxlength="30"
                show-word-limit
              >
              </el-input>
            </li>
          </ul>
        </div>

        <div class="next-p">
          <router-link tag='a' :to="{ path: '/indexPage' }" v-if="$route.query.u_type">跳过</router-link>
          <el-button type="primary" @click="next_page"
            >&nbsp;&nbsp;下&nbsp;&nbsp;一&nbsp;&nbsp;步&nbsp;&nbsp;></el-button
          >
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import indexTop from "../assemblyPublic/Index-top";
export default {
  data() {
    return {
      componyname:'',//公司名称
      value:'',
      textarea: "", //工作职责
      position: "", //职位
      bumen: "", //部门
      begin_date: "", //工作开始时间
      end_date: "", //工作结束时间
      options: [
        {
          value: "hulianwang",
          label: "互联网",
          children: [
            {
              value: "dianzishangwu",
              label: "电子商务",
              children: [
                {
                  value: "xinlingshou",
                  label: "新零售",
                },
                {
                  value: "dianshangfuwu",
                  label: "电商服务",
                },
                {
                  value: "B2B",
                  label: "B2B",
                },
              ],
            },
            {
              value: "rengongzhineng",
              label: "人工智能",
              children: [
                {
                  value: "jisuanjishijue",
                  label: "计算机视觉",
                },
                {
                  value: "yuyinshibie",
                  label: "语音识别",
                },
                {
                  value: "ziranyuyanchuli",
                  label: "自然语言处理",
                },
              ],
            },
          ],
        },
      ],
      options1: [
        {
          value: "选项11",
          label: "在校，寻找实习岗位",
        },
        {
          value: "选项22",
          label: "离校，急需工作",
        },
      ],
    };
  },
  methods: {
    checkstate() {
      this.state = "";
    },
    next_page() {
      alert('提交数据！')
      this.$axios({
          method: "POST",
          url: "api/work_set",
          data: {
            componyname:this.componyname,//公司名称
            value:this.value,
            textarea: this.textarea, //工作职责
            position: this.position, //职位
            bumen: this.bumen, //部门
            begin_date: this.begin_date, //工作开始时间
            end_date: this.end_date, //工作结束时间
          },
        })
          .then((result) => {
            // console.log(result.data);
            if (result.data.work_case == "ok") {
              // alert("登录成功！");
                this.$router.push({
                  path: "/indexMainPage",
                });

            } else {
              alert("存储失败");
            }
          })
          .catch((err) => {
            console.log(err);
          });
    },
  },
  components: {
    "v-indexTop": indexTop,
  },
};
</script>
<style scope>
.rsm-model .el-textarea__inner {
  height: 140px;
}
.next-p {
  width: 220px;
  float: right;
  margin-right: 130px;
  margin-top: 160px;
}
.next-p .el-button{
  float: right;
}



.rsm-main {
  width: 60%;
  background: rgb(253, 253, 253);
  margin: 50px auto;
  padding: 30px 0px;
  border: 1px solid rgb(202, 202, 202);
}

.r-h2 {
  width: 250px;
  float: left;
  margin-left: 5%;
  text-align: left;
}
.r-h2 span {
  color: rgb(184, 184, 189);
  font-size: 16px;
}

.rsm-model {
  width: 90%;
  height: 580px;
  margin: 0px auto;
  margin-top: 70px;
}
.rsm-model ul {
  width: 100%;
  background: rgb(87, 25, 145);
  text-align: left;
  font-size: 18px;
}
.rsm-model ul li {
  width: 50%;
  height: 100px;
  float: left;
  margin-top: 20px;
  color: rgb(76, 77, 78);
}
.rsm-model ul li p {
  margin-top: 10px;
  margin-bottom: 10px;
  padding-left: 3px;
}
.rsm-model .el-input__inner .el-radio {
  height: 50px;
}
.rsm-model .el-radio {
  width: 190px;
  background: white;
}
.rsm-model .el-input__inner {
  width: 425px;
}
.rsm-model .el-radio-button__inner,
.rsm-model .el-radio-button__orig-radio:checked + .el-radio-button__inner {
  width: 210px;
}
</style>
